import sqlite3
with sqlite3.connect('my_database.db') as conn:
    cursor = conn.cursor()
    cursor.execute('SELECT * FROM my_table')